﻿
namespace SistemaLogistica.Business.Logic
{
    using System;
    using System.Collections.Generic;
    using SistemaLogistica.Business.Entities;
    using SistemaLogistica.DataAccess;

    public  class NotaIngresoManager
    {
        private NotaIngresoManager() { }

        private static readonly NotaIngresoManager instancia = new NotaIngresoManager();

        public static NotaIngresoManager Instancia
        {
            get { return instancia; }
        }

        public List<NotaIngreso> Listar()
        {
            try
            {
                return NotaIngresoData.Instancia.Listar();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public NotaIngreso ObtenerPorID(int idNotaIngreso)
        {
            try
            {
                return NotaIngresoData.Instancia.ObtenerPorID(idNotaIngreso);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<int> ListarPorGuia(List<int> arreglo)
        {
            try
            {
                return NotaIngresoData.Instancia.ListarPorGuia(arreglo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public int Registrar(NotaIngreso  notaIngreso)
        {
            try
            {
                return NotaIngresoData.Instancia.Registrar(notaIngreso);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Modificar(NotaIngreso notaIngreso)
        {
            try
            {
                NotaIngresoData.Instancia.Modificar(notaIngreso);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Eliminar(int idNotaIngreso)
        {
            try
            {
                NotaIngresoData.Instancia.Eliminar(idNotaIngreso);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public NotaIngreso ObtenerPorFactura(int idFactura)
        {
            try
            {
                return NotaIngresoData.Instancia.ObtenerPorFactura(idFactura);
            }
            catch (Exception ex)
            {
                NotaIngreso notaIngreso=new NotaIngreso();
                ex.ToString();
                return notaIngreso;
            }

        }

        public List<NotaIngreso> Buscar(DateTime desde, DateTime hasta)
        {
            try
            {
                return NotaIngresoData.Instancia.Buscar(desde,hasta);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
